import request from '@/utils/request'

// 查询推荐帖审核列表
export function listRecommend(query) {
  return request({
    url: '/system/recommend/list',
    method: 'get',
    params: query
  })
}

// 查询推荐帖审核详细
export function getRecommend(recId) {
  return request({
    url: '/system/recommend/' + recId,
    method: 'get'
  })
}

// 新增推荐帖审核
export function addRecommend(data) {
  return request({
    url: '/system/recommend',
    method: 'post',
    data: data
  })
}

// 修改推荐帖审核
export function updateRecommend(data) {
  return request({
    url: '/system/recommend',
    method: 'put',
    data: data
  })
}

// 删除推荐帖审核
export function delRecommend(recId) {
  return request({
    url: '/system/recommend/' + recId,
    method: 'delete'
  })
}

//发送邮箱通知
export function sendEmail(data) {
  console.log(data)
  return request({
    url: '/email/send',
    method: 'get',
    //请求头使用键值对
    headers: { 'Content-Type': 'application/x-www-form-urlencoded'},
    params: data
  })
}
